package com.test.service;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.test.mapper.EbCommentMapper;
import com.test.model.EbComment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EbCommentService {

    @Autowired
    private  EbCommentMapper ebCommentMapper;
    //排序分页查询最新的留言信息

    public Page<EbComment> list(int psize, int limit){
        Page<EbComment> page = new Page<>(psize,limit);
        page.addOrder(OrderItem.desc("ecCreateTime"));//按时间降序
        return ebCommentMapper.selectPage(page,null);
    }
}
